home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
wordproc
/
hshell1.arj
/
PRICES.HYP
< prev
next >
Wrap
Text File
|
1993-12-29
|
3KB
|
153 lines
.REMARK
Price list demo driven by prices.lst file (viz).
Produces order.frm file for printing out. This could also
be done directly to the printer using action 'o'.
Note that references in frame, header and footer must appear above
the list if TAB/Shift TAB are to be used to select items.
.HEADER
[1] ~SNext page~Py;Slist~K1~E~Q [2] ~SProduce order form~PSorder~K2~E
.SCRIPT SETUP
-- open output file order.dat
worder.dat
.
.NOTE cdplayer
Philips triple overscanned
4 head multi player with
infra red remote control
.NOTE Television
Ferguson 23" FST with
teletext and stereo
wide angle, with IR
remote control handset
.NOTE Calculator
Casio 3 mips super
handheld holographic
realtime raytracing
four function with
memory calculator.
.REMARK
Display price list a screen full at a time, with wrap around.
.SCRIPT list
-- position text cursor at line 4
i~Y4
-- check run setting 22 (number of open input files) to see if input open
Vr&R22;vr0;jnRESTAT
-- reset variable i
Vi0
-- open input file
rprices.lst
LRESTAT
-- clear error status
Y
LREAD
-- read next line of file, splitting on ',' into variables d, p and g
R,dpg
-- if error status set, assume EOF (end of file)
jsEND
-- calculate character for mapping (a etc), put it in j
Vj=i%16+97;Vj&C$j
Vi=i+1
-- if variable g not defined, goto NODETS
vg;juNODETS
-- set g to reference selecting note called value of g
Vg~ADetails~PN$g~E
LNODETS
-- scale and align price from variable p into s
V&B2$p|s%8s
-- output formatted line to screen
i[$j]~C8~A$d~PSadd($i)~K$j~E~C40£$s~C60$g
-- if not on 16 boundary, loop back
Y=i%16;jnREAD
JPTOT
LEND
-- close input
r
LPTOT
-- scale total value for display
Vu&B2$t
-- display it
i~Y22 TOTAL~C40$u
.
.REMARK
Script add is called with item name as parameter.
Add item, mark line and display total.
.SCRIPT add
-- set k to parameter
Vk$\
-- write to output
W$k
-- refresh mouse cursor coords to get line position
ZG;Vy&Y
-- output asterisk at col 4 on line
i~Y$y~X4*
-- get whole line from price list
Vr@Fprices.lst($k)
-- split out price
er,dp
-- add to total
Vt=t+p
-- scale total for output
Vu&B2$t
-- output total
i~Y22 TOTAL~C40$u
.
.REMARK
Produce order file
Read through data file and fetch items from list file
.SCRIPT order
-- close input and output
r
w
-- open order form as output, with order details as input
worder.frm
rorder.dat
-- output order form
W ORDER FORM - ELECTRICAL GOODS
W
Vt0
Y
LREAD
-- get item name
Ri
-- at end of file, goto END
jsEND
-- get price
Vr@Fprices.lst($i)
er,dp
-- scale and fill price to 8 places
V&B2$p|s%8s
-- fill name to 30 places, left justified
Vf&W$d|%-30s
-- output name and price
W $f£$s
-- accumulate total
Vt=t+p
-- loop back
JREAD
-- here at end of file
LEND
-- close input
r
W
-- format total line
V&B2$t|s%8s
VfTOTAL|%-30s
W $f£$s
-- close output
w
-- display order form
Torder.frm
-- exit program
Q
.
.REMARK
test frame
.FRAME test
.TITLE price list test
Description Price
.